﻿using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Wicture.QPZS.EPC.API.InvokeContextBuilders.InvokeResultJudges
{
    public class QueryPartsResultJudge : InvokeResultJudge
    {
        public override string ServiceName => "QueryParts";

        public override bool Judge(object result)
        {
            var data = JToken.FromObject(result);
            var parts = data.Value<IEnumerable<object>>("parts");
            return parts.Any();
        }
    }
}
